<%@ page import="java.util.Date" %>
<%@ page import="java.util.List" %>
<%@ page import="com.qf.pojo.EmpManager" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: zhaojian
  Date: 2023/9/11
  Time: 9:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%= new Date() %>

    <%-- 这里可以写注释 --%>

    <%
    int i = 0;
    if (i == 0) {
        out.println("===========");

    }
    %>


    <%
        //获取servlet用setAttribute方法传入页面的数据
        List<EmpManager> empList = (ArrayList<EmpManager>)request.getAttribute("empList");
        //页面中java代码的变量, 无法用el表达式直接获取展示, 因为不在四大域对象中.
        String aaa = "展示el表达式";
        request.setAttribute("aaa", aaa);
        for (EmpManager empManager : empList) {
            //将遍历出来的数据, 放入请求域中, 这样el表达式才可以获取到并展示到页面
            request.setAttribute("temp", empManager);
            %>


            <a>
                ${aaa}
            </a>
    <%
        }

        //路径, 项目的虚拟路径
        String contextPath = request.getContextPath();
        out.println(contextPath);
    %>

    <a>${empList}</a>
</body>
</html>
